﻿<%@ Control Language="C#" Inherits="Forum.Business.MyPostEdit, Forum.Business" AutoEventWireup="true" %>
<%@Register tagPrefix="ctrl" tagName="Editor" src="~/themes/default/skins/Skin-HtmlEditor.ascx" %>

<script language="javascript">
    function checkForm(){
         var bodyEditor = tinyMCE.getInstanceById("<%= bodyEditor.EditorClientID %>");
         var content = bodyEditor.getBody().innerHTML;
         content = content.toText().Trim();
         if(content==null||content=="")
         {
               alert('内容不能为空');
               tinyMCE.execCommand('mceFocus', false, '<%= bodyEditor.EditorClientID %>');
               return false;
         }
        return true;
    } 
</script>

<div class="AdminArea">
    <fieldset>
        <legend><ctrl:ResourceLiteral runat="server" ResourceName="System_ControlPanel_Post_EditControlTitle" ResourceFile="ControlPanelResources.xml" /></legend>
        <div class="FormRow">
            <ctrl:ResourceLabel CssClass="FieldName" runat="Server" ControlToLabel="bodyEditor" ResourceFile="ControlPanelResources.xml" ResourceName="System_ControlPanel_Post_Body" />
            <br /><br /><ctrl:Editor Runat="server" Width="100%" Height="250px" id="bodyEditor" />
        </div>        
        <div class="FormRow SubmitButtonRow">
            <ctrl:Resourcebutton id="saveButton" OnClientClick="return checkForm();" ResourceName="Save" CssClass="Button" Runat="server"></ctrl:Resourcebutton>
        </div>
    </fieldset>
</div>